package com.energy.analysis.sys.service;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.energy.analysis.comm.utils.DateUtils;
import com.energy.analysis.sys.entity.OprInfoLoginLog;
import com.energy.analysis.sys.mapper.OprInfoLoginLogMapper;
@Service
public class OprInfoLoginLogService {
	@Autowired
	OprInfoLoginLogMapper oprInfoLoginLogMapper;
	
	public void writeloginLog(String loginId, String sessionId, String ip) {
		OprInfoLoginLog mercLoginLog = new OprInfoLoginLog(); 
		mercLoginLog.setIp(ip);
		mercLoginLog.setLoginId(loginId);
		mercLoginLog.setSessionId(sessionId);
		mercLoginLog.setLoginSts("01");
		mercLoginLog.setCrtDt(DateUtils.getYmdDate());
		mercLoginLog.setCrtTm(DateUtils.getHmsTime());
		oprInfoLoginLogMapper.insert(mercLoginLog) ;
	}
	public Map<String,Object> getLoginLastDt(String  loginId){
		return oprInfoLoginLogMapper.getLoginLastDt(loginId);
	}
}
